import axios from 'axios'
export const getListData=(data)=>{
    return {
        type: 'GETLISTS',
        payload:data
    }
}
export const fetchList=(params={page:1})=>{
    return (dispatch)=>{
        const url=`http://129.211.16.185:3000/product?_page=${params.page}&_limit=12&_sort=id`
        axios({
            url:url,
            method:"get"
        }).then(res=>{
            var obj={
                pageData:res.data,
                total:res.headers['x-total-count']
            }
            dispatch(getListData(obj));
        })
    }
    
}